home *** CD-ROM | disk | FTP | other *** search
/ Languguage OS 2 / Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO / language / dino / dino_bot.1 / source / library / node_main.c < prev    next >
Encoding:
C/C++ Source or Header  |  1991-04-27  |  1.3 KB  |  69 lines

  1. /* Copyright, 1990, Regents of the University of Colorado */
  2. /* main routine for all non host environments*/
  3.  
  4. #include "D_lib.h"
  5. #include "internal.h"
  6. #include <stdio.h>
  7.  
  8. extern int D_ci;
  9.  
  10. /********************************************************************
  11.  *
  12.  *  NAME:       D_comp_driver --- Main driver on the nodes that looks
  13.  *              for and calls composite procedures.
  14.  *
  15.  *  INPUTS:       
  16.  *
  17.  *  OUTPUTS:    
  18.  *
  19.  *  NOTES:      See the formal interface description for more
  20.  *              information.
  21.  *
  22.  ********************************************************************/
  23.  
  24. void D_comp_driver()
  25.      {
  26.     int cnt;
  27.     int node;
  28.     int pid;
  29.  
  30.     for (;;)
  31.        {
  32. #if (D_MACH==D_CUBE)
  33.         while (probe(D_ci, D_CPC_MTYPE) < 0)
  34.             flick();
  35. #elif (D_MACH==D_SIM)
  36. #else
  37.         while (iprobe(D_CPC_MTYPE) == 0)
  38.             flick();
  39. #endif
  40.  
  41.  
  42. #if (D_MACH==D_SIM || D_MACH==D_CUBE)
  43.         recvw(D_ci, D_CPC_MTYPE, &(D_mess_buf[0]), D_MAX_MESS,
  44.                                                         &cnt, &node, &pid);
  45. #else
  46.         crecv((long)D_CPC_MTYPE, &(D_mess_buf[0]), (long)D_MAX_MESS);
  47. #endif
  48.         (*D_comps[D_mess_lint[3]])();
  49.         }
  50.     }
  51.  
  52. #if (D_MACH==D_GRAIL)
  53. nd_main() { 
  54. #else
  55. main(){
  56. #endif
  57.     D_env_init(((int) D_last_env) + 1);
  58.  
  59.     /*initialize distributed data constants*/
  60.     D_init_global_const();
  61.     D_init_global_map();
  62.     D_init_local_const();
  63.     D_init_local_map();
  64.  
  65.     /*handle composite procedures forever*/
  66.     D_comp_driver();
  67.     };
  68.  
  69.